section.col-xs-12.content(ng-controller="SettingsGatewayCtrl")
  div(ng-show='debug') This page is not available in debug mode

  div(ng-show="!loadingAccount && !account.Balance && loadState.account && connected && !debug")
    include ../tabs/banner/unfunded
  .row(ng-show='!debug')
    .col-sm-12.notification-wrapper
      .alert.alert-success(ng-show="success.bridge", l10n) Your bitcoin bridge has been changed successfully.
      .alert.alert-success(ng-show="success.advanced_feature_switch", l10n) Trustline advanced settings have been changed successfully.
      .alert.alert-info(ng-show="edit.defaultRippleFlagSaving", l10n) Updating DefaultRipple flag...
      .alert.alert-success(ng-show="notif == 'defaultRippleUpdated'", l10n) DefaultRipple flag updated
    .col-sm-3
      include ../tabs/settings/navbar
    .col-sm-9.list
      section.content#gateways
        h4(l10n) Settings
        //- mixin urlForm(urlType, formName, formDescriptor, description, inputName, hasDelete)
        //-   form(name=formName, ng-submit='save("'+urlType+'")')
        //-     .descriptor(l10n)= formDescriptor
        //-     .row.advanced-form-row(ng-hide='edit.'+urlType)
        //-       .col-xs-9.col-sm-8.col-md-6
        //-         .description(l10n)= description.url
        //-       .col-xs-1
        //-       .col-xs-3.col-sm-3.col-md-2
        //-         a.btn.btn-block.btn-cancel(href="", ng-click='edit.'+urlType+' = true', l10n) edit
        //-     .row.row-padding-small.field-edit-row(ng-show='edit.'+urlType)
        //-       .col-xs-12.col-sm-9.col-md-6
        //-         input.form-control(
        //-         class=inputName
        //-         id=inputName
        //-         name=inputName, type='text'
        //-         ng-model=description.ngModel
        //-         required)
        //-       .col-xs-6.col-sm-6.col-md-3
        //-         button.btn.btn-block.btn-success.btn-xs.submit#save(type='submit', ng-disabled=formName+'.$invalid', l10n) Save
        //-       if hasDelete
        //-         .col-xs-3.col-sm-3.col-md-2
        //-           button.btn.btn-block.btn-danger.btn-xs.submit#delete(type="button", ng-click='deleteUrl("'+urlType+'")', l10n) Delete
        //-       .col-xs-3.col-sm-3.col-md-1.text-center#cancel
        //-         a.btn.btn-cancel.btn-block(href="", ng-click='cancelEdit("'+urlType+'")', l10n) cancel
        //- +urlForm('bridge', 'bridgeForm', 'Bitcoin bridge', {url: '{{options.bridge.out.bitcoin}}', ngModel: 'options.bridge.out.bitcoin'}, 'btcDomain', true)

        form.trust-line-form(name="accountsAdvForm", ng-submit='save("advanced_feature_switch")')
          .descriptor(l10n) Trust line
          .row.advanced-form-row(ng-hide="edit.advanced_feature_switch")
            .col-xs-6.col-sm-5.col-md-3
              .description(l10n) Advanced settings
            .col-xs-3.col-sm-4.col-md-4
              .description(ng-show="options.advanced_feature_switch", l10n) Show
              .description(ng-hide="options.advanced_feature_switch", l10n) Hide
            .col-xs-3.col-sm-3.col-md-2
              a.btn.btn-cancel.btn-block(href="", ng-click="edit.advanced_feature_switch = true", l10n) edit
          .row.row-padding-small.edit-trust-line(ng-show="edit.advanced_feature_switch")
            .col-xs-6.col-sm-5.col-md-3
              .description(l10n) Advanced settings
            .col-xs-4.col-sm-4.col-md-3
              div.helperInput
                label
                  input(type="checkbox", name="acct_adv"
                  ng-model="options.advanced_feature_switch")
                  span(l10n) Show
            .col-xs-12.col-sm-4.col-md-4
              button.btn.btn-block.btn-success.btn-xs.submit#save(type='submit'
              ng-disabled='serverForm.$invalid', l10n) Save
            .col-xs-6(ng-show="hasRemove()")
              button.btn.btn-block.btn-danger.btn-xs.submit#delete(type="button", ng-click="remove()", ng-show="hasRemove()", l10n) Delete
        form.trust-line-form(name="accountsAdvForm", ng-submit='save("defaultRippleFlag")')
          .descriptor(l10n) Gateways: Enable if you plan to issue balances
          .row.advanced-form-row(ng-hide="edit.defaultRippleFlag")
            .col-xs-6.col-sm-5.col-md-3
              .description(l10n) DefaultRipple flag
            .col-xs-3.col-sm-4.col-md-4
              .description(ng-show="currentDefaultRipplingFlagSetting && !edit.defaultRippleFlagSaving", l10n) Enabled
              .description(ng-hide="currentDefaultRipplingFlagSetting || edit.defaultRippleFlagSaving", l10n) Disabled
              .description(ng-show="edit.defaultRippleFlagSaving")
                img(src="img/button-s.png", class="loader")
            .col-xs-3.col-sm-3.col-md-2
              a.btn.btn-cancel.btn-block(href="", ng-click="edit.defaultRippleFlag = true", ng-hide="edit.defaultRippleFlagSaving", l10n) edit
          .row.row-padding-small.edit-trust-line(ng-show="edit.defaultRippleFlag")
            .col-xs-6.col-sm-5.col-md-3
              .description(l10n) DefaultRipple flag
            .col-xs-4.col-sm-4.col-md-3
              div.helperInput
                label
                  input(type="checkbox", name="acct_adv"
                  ng-model="isDefaultRippleFlagEnabled")
                  span(l10n) Enable
            .col-xs-12.col-sm-4.col-md-4
              button.btn.btn-block.btn-success.btn-xs.submit#save(type='submit'
              ng-disabled='serverForm.$invalid', l10n) Save
            .col-xs-3(ng-show="hasRemove()")
              button.btn.btn-block.btn-danger.btn-xs.submit#delete(type="button", ng-click="remove()", ng-show="hasRemove()", l10n) Delete
